<html>

<table width=100%><tr>
    <td align=left> <a href="build.html">&lt;- Download and Install</a></td>
    <td align=right><a href="osgdirectives.html">.OSG File Directive -&gt;</a></td>
</tr>
</table>

<hr>

<h2> Simple usage</h2>

  <p>
  Once the osgEphemeris library (osgEphemeris.so) and the osgEphemeris Plugin 
  (osgdb_osgEphemerisModel.so) are installed in the normal search paths for
  osgDB, <i>osgEphemeris</i> can be used with a simple .osg file.  As an example,
  save the following into a file named <i>ephemeris.osg</i> and use it on the 
  command line with <i>osgviewer</i>.  (We'll assume that you will use this 
  file with a piece of terrain, named <i>terrain.osg</i>, which can be confined 
  within a skydome of radius 100000):

  <p>
  <table bgcolor=#DDDDDD width=100%>
    <tr>
      <td>
  <blockquote>
        <PRE>
    osgEphemerisModel::EphemerisModel {
        Latitude 38.4765
        Longitude -122.493
        SkyDomeRadius 100000
    }
        </PRE>
  </blockquote>
      </td>
    </tr>
  </table>

  <p>
  Like this:

  <table bgcolor=#DDDDDD width=100%>
    <tr>
      <td>
  <blockquote>
        <PRE>
        osgviewer --clear-color 0,0,0,1 ephemeris.osg terrain.osg
        </PRE>
  </blockquote>
      </td>
    </tr>
  </table>

  <p>
  Note, that it is recommended to use the argument <code> --clear-color 0,0,0,1 </code>
  which provides a black background as opposed to the OSG bluish default clear color.

  <p>
  Also note that the terrain will be distant and centered from the viewpoint, and 
  probably not visible.  The skydome will remain fixed at the eyepoint and will likely
  obscure the terrain in <i>Trackball mode</i>.  Simply pull the terrain database toward 
  the view with the right mouse button, or center the view by typing '3' (to enter 
  'DriveManipulator mode') followed by the &lt;space&gt; bar.  

  <p>
  This example uses three directives in the <i>.osg</i> file: <b>Latitude</b>, <b>Longitude</b>,
  and <b>SkyDomeRadius</b>.  <b>Latitude</b> and <b>Longitude</b> are the position of the viewer
  on planet earth, given in degrees.  Negative values represent South and Western hemispheres
  respectively.  The values given in the example correspond to San Francisco, California.

  <p>
  <b>SkyDomeRadius</b> refers to the size of the skydome's radius.  By default, the skydome 
  has a radius of the distance between the earth and the moon, or <b>384403.0 kilometers</b>.  
  Most terrain databases will become dwarfed by this large sky dome and will probably not
  even be visible.  Set this value to something that is large enough to encompass the 
  terrain you will be viewing, but not so large that it will cause visual anomalies.

  <p>
  For example, if the terrain is a block 25 Km by 25 Km, then set the radius to about
  25000 (25 Km - assuming meters as units).

  <hr>
<table width=100%><tr>
    <td align=left> <a href="build.html">&lt;- Download and Install</a></td>
    <td align=right><a href="osgdirectives.html">.OSG File Directive -&gt;</a></td>
</tr>
</table>

</html>
